package entity_controllers.options.effects;

import misc.MArrayList;
import core.subcontrollers.SubController;
import ie.FieldBoard;
import ie.PlayerBoard;
import ie.Shaker;
import dto.Player;
import entity.Account;
import entity.fields.properties.Street;
import entity_controllers.Option;
import entity_controllers.options.BuyHouseOption;
import entity_controllers.options.SellHouseOption;
import entity_controllers.options.ShakeMoveOption;

public class MoveEffect extends Option {

	public MoveEffect(String title) {
		super("");
	}

	@Override
	public void execute(Player player, FieldBoard gameBoard, PlayerBoard playerList, Shaker shaker) {
		
		((Account) player.getAccount()).getOM().getOption(ShakeMoveOption.class).enable();

		// if the player owns a full street group
		if (SubController.streetConstruction(player, gameBoard, new MArrayList<Street>()))
			((Account) player.getAccount()).getOM().getOption(BuyHouseOption.class).enable();

		// if the player owns streets
		if (((Account) player.getAccount()).hasBuildings())
			((Account) player.getAccount()).getOM().getOption(SellHouseOption.class).enable();
		
	}

	@Override
	public void reset() {
	}

}
